package com.jmu.account;

import java.util.Date;

public class TestAccount {
    /**
     * 测试类
     * @param args
     */
    public static void main(String[] args) {
        Account account = new Account("0001","A",0.02,new Date(2015,2,7));
        SavingAccount savingAccount = new SavingAccount("0002","B",0.01,new Date(2018,1,1));
        CheckingAccount checkingAccount = new CheckingAccount("0003","C",0.002,new Date(2013,5,7),500);

        System.out.println(account.toString());
        System.out.println("--->向账户中存入500：");
        account.Deposit(500);
        System.out.println("--->向账户中取出600：");
        account.Withdraw(600);
        System.out.println("----------------------");

        System.out.println(savingAccount.toString());
        System.out.println("--->向账户中存入10：");
        savingAccount.Deposit(10);
        System.out.println("--->向账户中取出410：");
        savingAccount.Withdraw(410);
        System.out.println("----------------------");

        System.out.println(checkingAccount.toString());
        System.out.println("--->向账户中存入600：");
        checkingAccount.Deposit(600);
        System.out.println("--->向账户中取出710：");
        checkingAccount.Withdraw(710);
        System.out.println("--->再向账户中取出800：");
        checkingAccount.Withdraw(800);
        System.out.println("----------------------");
    }
}
